﻿IF OBJECT_ID('cms_oper_log') IS NOT NULL
BEGIN
    DROP TABLE cms_oper_log
    PRINT '<<< DROPPED TABLE cms_oper_log >>>'
END
GO
CREATE TABLE cms_oper_log(
    LogID        int             IDENTITY(1,1),
    UserID       int             NULL,
    UserName     varchar(50)     NULL,
    IP           char(20)        NULL,
    Action       varchar(100)    NULL,
    ActionURL    varchar(300)    NOT NULL,
    AddTime      datetime        DEFAULT getdate() NOT NULL,
    CONSTRAINT PK87 PRIMARY KEY NONCLUSTERED (LogID)
)
GO
IF OBJECT_ID('cms_oper_log') IS NOT NULL
    PRINT '<<< CREATED TABLE cms_oper_log >>>'
ELSE
    PRINT '<<< FAILED CREATING TABLE cms_oper_log >>>'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'LogID'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'LogID'
END
exec sys.sp_addextendedproperty 'MS_Description', '日志ID', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'LogID'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'UserID'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'UserID'
END
exec sys.sp_addextendedproperty 'MS_Description', '用户ID', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'UserID'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'UserName'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'UserName'
END
exec sys.sp_addextendedproperty 'MS_Description', '用户名', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'UserName'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'IP'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'IP'
END
exec sys.sp_addextendedproperty 'MS_Description', 'IP', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'IP'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'Action'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'Action'
END
exec sys.sp_addextendedproperty 'MS_Description', 'Action', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'Action'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'ActionURL'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'ActionURL'
END
exec sys.sp_addextendedproperty 'MS_Description', 'ActionURL', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'ActionURL'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'AddTime'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'AddTime'
END
exec sys.sp_addextendedproperty 'MS_Description', '添加时间', 'schema', 'dbo', 'table', 'cms_oper_log', 'column', 'AddTime'
GO
IF EXISTS( SELECT 1 FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME='cms_oper_log_Save' AND ROUTINE_TYPE='PROCEDURE')
DROP PROCEDURE cms_oper_log_Save
GO 
CREATE PROCEDURE cms_oper_log_Save
@LogID    	int OUTPUT,
@UserID    	int,
@UserName    	varchar(50),
@IP    	char(20),
@Action    	varchar(100),
@ActionURL    	varchar(300),
@AddTime    	datetime
AS
IF (@LogID>0) 
BEGIN
	UPDATE cms_oper_log
	SET 
		[UserID] = @UserID,
		[UserName] = @UserName,
		[IP] = @IP,
		[Action] = @Action,
		[ActionURL] = @ActionURL,
		[AddTime] = @AddTime
	WHERE [LogID]=@LogID
END
ELSE
BEGIN
	INSERT INTO cms_oper_log([UserID],[UserName],[IP],[Action],[ActionURL],[AddTime])
	VALUES(@UserID,@UserName,@IP,@Action,@ActionURL,@AddTime)
	SET @LogID = @@IDENTITY
END
GO
IF OBJECT_ID('cms_user_AdminUsers') IS NOT NULL
BEGIN
    DROP TABLE cms_user_AdminUsers
    PRINT '<<< DROPPED TABLE cms_user_AdminUsers >>>'
END
GO
IF OBJECT_ID('cms_user_UserPermission') IS NOT NULL
BEGIN
    DROP TABLE cms_user_UserPermission
    PRINT '<<< DROPPED TABLE cms_user_UserPermission >>>'
END
GO
CREATE TABLE cms_user_AdminUsers(
    UserBaseId       int               IDENTITY(1,1),
    LogName          nvarchar(200)     NULL,
    LogPWD           varchar(200)      NULL,
    Name             nvarchar(200)     NULL,
    Sex              bit               DEFAULT 0 NOT NULL,
    LastLogTime      datetime          DEFAULT getdate() NOT NULL,
    AddTime          datetime          DEFAULT getdate() NOT NULL,
    PubCount         int               NULL,
    PermissionIds    varchar(300)      NULL,
    NodeIds          nvarchar(2000)    NULL,
    CONSTRAINT PK__cms_user_AdminUsers PRIMARY KEY NONCLUSTERED (UserBaseId)
)
GO
IF OBJECT_ID('cms_user_AdminUsers') IS NOT NULL
    PRINT '<<< CREATED TABLE cms_user_AdminUsers >>>'
ELSE
    PRINT '<<< FAILED CREATING TABLE cms_user_AdminUsers >>>'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'UserBaseId'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'UserBaseId'
END
exec sys.sp_addextendedproperty 'MS_Description', '用户id', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'UserBaseId'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'LogName'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'LogName'
END
exec sys.sp_addextendedproperty 'MS_Description', '用户登陆名', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'LogName'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'LogPWD'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'LogPWD'
END
exec sys.sp_addextendedproperty 'MS_Description', '登陆密码', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'LogPWD'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'Name'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'Name'
END
exec sys.sp_addextendedproperty 'MS_Description', '用户昵称', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'Name'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'Sex'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'Sex'
END
exec sys.sp_addextendedproperty 'MS_Description', '性别', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'Sex'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'LastLogTime'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'LastLogTime'
END
exec sys.sp_addextendedproperty 'MS_Description', '最后登陆时间', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'LastLogTime'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'AddTime'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'AddTime'
END
exec sys.sp_addextendedproperty 'MS_Description', '注册时间', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'AddTime'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'PubCount'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'PubCount'
END
exec sys.sp_addextendedproperty 'MS_Description', '信息发布个数', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'PubCount'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'PermissionIds'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'PermissionIds'
END
exec sys.sp_addextendedproperty 'MS_Description', '权限Id集合', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'PermissionIds'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'NodeIds'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'NodeIds'
END
exec sys.sp_addextendedproperty 'MS_Description', '可操作结点Id集合', 'schema', 'dbo', 'table', 'cms_user_AdminUsers', 'column', 'NodeIds'
GO
CREATE TABLE cms_user_UserPermission(
    UserRightCodeId    int              IDENTITY(1,1),
    ParentId           int              NULL,
    KeyWord            varchar(100)     NOT NULL,
    Description        nvarchar(500)    NULL,
    CONSTRAINT PK__cms_user_UserRightCode PRIMARY KEY NONCLUSTERED (UserRightCodeId)
)
GO
IF OBJECT_ID('cms_user_UserPermission') IS NOT NULL
    PRINT '<<< CREATED TABLE cms_user_UserPermission >>>'
ELSE
    PRINT '<<< FAILED CREATING TABLE cms_user_UserPermission >>>'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_UserPermission', 'column', 'UserRightCodeId'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_UserPermission', 'column', 'UserRightCodeId'
END
exec sys.sp_addextendedproperty 'MS_Description', '权限Id', 'schema', 'dbo', 'table', 'cms_user_UserPermission', 'column', 'UserRightCodeId'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_UserPermission', 'column', 'ParentId'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_UserPermission', 'column', 'ParentId'
END
exec sys.sp_addextendedproperty 'MS_Description', '父Id', 'schema', 'dbo', 'table', 'cms_user_UserPermission', 'column', 'ParentId'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_UserPermission', 'column', 'KeyWord'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_UserPermission', 'column', 'KeyWord'
END
exec sys.sp_addextendedproperty 'MS_Description', '关键字', 'schema', 'dbo', 'table', 'cms_user_UserPermission', 'column', 'KeyWord'
GO
if exists (select * from ::fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', 'cms_user_UserPermission', 'column', 'Description'))
BEGIN
    exec sys.sp_dropextendedproperty 'MS_Description', 'schema', 'dbo', 'table', 'cms_user_UserPermission', 'column', 'Description'
END
exec sys.sp_addextendedproperty 'MS_Description', '描述', 'schema', 'dbo', 'table', 'cms_user_UserPermission', 'column', 'Description'
GO
IF EXISTS( SELECT 1 FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME='cms_UserPermission_Save' AND ROUTINE_TYPE='PROCEDURE')
DROP PROCEDURE cms_UserPermission_Save
GO 
CREATE PROCEDURE cms_UserPermission_Save
@UserRightCodeId    	int OUTPUT,
@ParentId    	int,
@KeyWord    	varchar(100),
@Description    	nvarchar(500)
AS
IF (@UserRightCodeId>0) 
BEGIN
	UPDATE cms_user_UserPermission
	SET 
		[ParentId] = @ParentId,
		[KeyWord] = @KeyWord,
		[Description] = @Description
	WHERE [UserRightCodeId]=@UserRightCodeId
END
ELSE
BEGIN
	INSERT INTO cms_user_UserPermission([ParentId],[KeyWord],[Description])
	VALUES(@ParentId,@KeyWord,@Description)
	SET @UserRightCodeId = @@IDENTITY
END
GO
IF EXISTS( SELECT 1 FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME='cms_AdminUser_Save' AND ROUTINE_TYPE='PROCEDURE')
DROP PROCEDURE cms_AdminUser_Save
GO 
CREATE PROCEDURE cms_AdminUser_Save
@UserBaseId    	int OUTPUT,
@LogName    	nvarchar(200),
@LogPWD    	varchar(200),
@Name    	nvarchar(200),
@Sex    	bit,
@LastLogTime    	datetime,
@AddTime    	datetime,
@PubCount    	int,
@PermissionIds    	varchar(300),
@NodeIds    	nvarchar(2000)
AS
IF (@UserBaseId>0) 
BEGIN
	UPDATE cms_user_AdminUsers
	SET 
		[LogName] = @LogName,
		[LogPWD] = @LogPWD,
		[Name] = @Name,
		[Sex] = @Sex,
		[LastLogTime] = @LastLogTime,
		[AddTime] = @AddTime,
		[PubCount] = @PubCount,
		[PermissionIds] = @PermissionIds,
		[NodeIds] = @NodeIds
	WHERE [UserBaseId]=@UserBaseId
END
ELSE
BEGIN
	INSERT INTO cms_user_AdminUsers([LogName],[LogPWD],[Name],[Sex],[LastLogTime],[AddTime],[PubCount],[PermissionIds],[NodeIds])
	VALUES(@LogName,@LogPWD,@Name,@Sex,@LastLogTime,@AddTime,@PubCount,@PermissionIds,@NodeIds)
	SET @UserBaseId = @@IDENTITY
END
GO
SET IDENTITY_INSERT cms_user_AdminUsers ON
insert into cms_user_AdminUsers(UserBaseId,LogName,LogPWD,Name,Sex,LastLogTime,AddTime,PubCount,PermissionIds,NodeIds)
 values 
('1','admin','e10adc3949ba59abbe56e057f20f883e','Admin管理员','False','2011/4/22 13:57:40','2011/4/11 10:58:42','0','all','all')
SET IDENTITY_INSERT cms_user_AdminUsers OFF

SET IDENTITY_INSERT [cms_user_UserPermission] ON
DELETE FROM   [cms_user_UserPermission]
INSERT INTO [cms_user_UserPermission] (UserRightCodeId,[ParentId] ,[KeyWord] ,[Description]) VALUES ( 1, 0,'SystemManage_All',    '系统管理')
INSERT INTO [cms_user_UserPermission] (UserRightCodeId,[ParentId] ,[KeyWord] ,[Description]) VALUES ( 2, 1,'SystemManage_User',   '用户管理')
INSERT INTO [cms_user_UserPermission] (UserRightCodeId,[ParentId] ,[KeyWord] ,[Description]) VALUES ( 3, 1,'SystemManage_Other',  '其他')
INSERT INTO [cms_user_UserPermission] (UserRightCodeId,[ParentId] ,[KeyWord] ,[Description]) VALUES ( 4, 0,'Plugin_All',          '插件管理')
INSERT INTO [cms_user_UserPermission] (UserRightCodeId,[ParentId] ,[KeyWord] ,[Description]) VALUES ( 5, 4,'Plugin_List',          '插件管理')
INSERT INTO [cms_user_UserPermission] (UserRightCodeId,[ParentId] ,[KeyWord] ,[Description]) VALUES ( 6, 4,'Plugin_comment',       '评论管理')
INSERT INTO [cms_user_UserPermission] (UserRightCodeId,[ParentId] ,[KeyWord] ,[Description]) VALUES ( 7, 4,'Plugin_Advertisement','广告管理')
INSERT INTO [cms_user_UserPermission] (UserRightCodeId,[ParentId] ,[KeyWord] ,[Description]) VALUES ( 8, 0,'NodeContent_all',     '结点管理')
INSERT INTO [cms_user_UserPermission] (UserRightCodeId,[ParentId] ,[KeyWord] ,[Description]) VALUES ( 9, 8,'NodeContent_Node',    '站点管理')
INSERT INTO [cms_user_UserPermission] (UserRightCodeId,[ParentId] ,[KeyWord] ,[Description]) VALUES ( 10,8,'NodeContent_Content', '发布管理')
SET IDENTITY_INSERT [cms_user_UserPermission] OFF
GO
/* Bug修复的SQL */
ALTER TABLE cms_node_Node ADD
	ParentPath nvarchar(200) NULL,
	ArrChildId nvarchar(500) NULL
GO
/* 保存 Save cms_Node */
IF EXISTS( SELECT 1 FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME='cms_Node_Save' AND ROUTINE_TYPE='PROCEDURE')
DROP PROCEDURE cms_Node_Save
GO 
CREATE PROCEDURE cms_Node_Save
@NodeId    	int OUTPUT,
@Editor    	nvarchar(50),
@Pager    	varchar(50),
@IndexName    	varchar(250),
@IndexPortalURL    	varchar(300),
@ContentPortalURL    	varchar(300),
@InheritNodeID    	int,
@ParentId    	int,
@ModelId    	int,
@Name    	nvarchar(200),
@KeyWord    	varchar(100),
@Url    	varchar(300),
@ContentWorkFlowId    	int,
@NodeTypeId    	int,
@ContentPubTypeId    	int,
@IsAuoPub    	bit,
@IsContribute    	bit,
@IsHidde    	bit,
@DisplayOrder    	int,
@Detail    	ntext,
@IndexTemplate    	varchar(300),
@ImageTemplate    	varchar(300),
@DetailTemplate    	varchar(300),
@SourcePSN    	varchar(300),
@SourceUrl    	varchar(300),
@SourceRootReg    	nvarchar(500),
@HtmlPSN    	varchar(300),
@HtmlUrl    	varchar(300),
@HtmlRootReg    	nvarchar(500),
@HtmlNameReg    	nvarchar(500),
@SEOTitle    	nvarchar(200),
@SEOKey    	nvarchar(200),
@SEODescription    	nvarchar(500),
@ReadLimit    	int,
@AddTime    	datetime,
@AddUserId    	int,
@UpdateUserId    	int,
@UpdateTime    	datetime,
@WaterPic    	varchar(300),
@IsWater    	bit,
@Extcredits1    	decimal,
@Extcredits2    	decimal,
@Extcredits3    	nvarchar(200),
@Extcredits4    	nvarchar(200),
@Extcredits5    	nvarchar(200),
@ParentPath    	nvarchar(200),
@ArrChildId    	nvarchar(500)
AS
IF (@NodeId>0) 
BEGIN
	UPDATE cms_node_Node
	SET 
		[Editor] = @Editor,
		[Pager] = @Pager,
		[IndexName] = @IndexName,
		[IndexPortalURL] = @IndexPortalURL,
		[ContentPortalURL] = @ContentPortalURL,
		[InheritNodeID] = @InheritNodeID,
		[ParentId] = @ParentId,
		[ModelId] = @ModelId,
		[Name] = @Name,
		[KeyWord] = @KeyWord,
		[Url] = @Url,
		[ContentWorkFlowId] = @ContentWorkFlowId,
		[NodeTypeId] = @NodeTypeId,
		[ContentPubTypeId] = @ContentPubTypeId,
		[IsAuoPub] = @IsAuoPub,
		[IsContribute] = @IsContribute,
		[IsHidde] = @IsHidde,
		[DisplayOrder] = @DisplayOrder,
		[Detail] = @Detail,
		[IndexTemplate] = @IndexTemplate,
		[ImageTemplate] = @ImageTemplate,
		[DetailTemplate] = @DetailTemplate,
		[SourcePSN] = @SourcePSN,
		[SourceUrl] = @SourceUrl,
		[SourceRootReg] = @SourceRootReg,
		[HtmlPSN] = @HtmlPSN,
		[HtmlUrl] = @HtmlUrl,
		[HtmlRootReg] = @HtmlRootReg,
		[HtmlNameReg] = @HtmlNameReg,
		[SEOTitle] = @SEOTitle,
		[SEOKey] = @SEOKey,
		[SEODescription] = @SEODescription,
		[ReadLimit] = @ReadLimit,
		[AddTime] = @AddTime,
		[AddUserId] = @AddUserId,
		[UpdateUserId] = @UpdateUserId,
		[UpdateTime] = @UpdateTime,
		[WaterPic] = @WaterPic,
		[IsWater] = @IsWater,
		[Extcredits1] = @Extcredits1,
		[Extcredits2] = @Extcredits2,
		[Extcredits3] = @Extcredits3,
		[Extcredits4] = @Extcredits4,
		[Extcredits5] = @Extcredits5,
		[ParentPath] = @ParentPath,
		[ArrChildId] = @ArrChildId
	WHERE [NodeId]=@NodeId
END
ELSE
BEGIN
	INSERT INTO cms_node_Node([Editor],[Pager],[IndexName],[IndexPortalURL],[ContentPortalURL],[InheritNodeID],[ParentId],[ModelId],[Name],[KeyWord],[Url],[ContentWorkFlowId],[NodeTypeId],[ContentPubTypeId],[IsAuoPub],[IsContribute],[IsHidde],[DisplayOrder],[Detail],[IndexTemplate],[ImageTemplate],[DetailTemplate],[SourcePSN],[SourceUrl],[SourceRootReg],[HtmlPSN],[HtmlUrl],[HtmlRootReg],[HtmlNameReg],[SEOTitle],[SEOKey],[SEODescription],[ReadLimit],[AddTime],[AddUserId],[UpdateUserId],[UpdateTime],[WaterPic],[IsWater],[Extcredits1],[Extcredits2],[Extcredits3],[Extcredits4],[Extcredits5],[ParentPath],[ArrChildId])
	VALUES(@Editor,@Pager,@IndexName,@IndexPortalURL,@ContentPortalURL,@InheritNodeID,@ParentId,@ModelId,@Name,@KeyWord,@Url,@ContentWorkFlowId,@NodeTypeId,@ContentPubTypeId,@IsAuoPub,@IsContribute,@IsHidde,@DisplayOrder,@Detail,@IndexTemplate,@ImageTemplate,@DetailTemplate,@SourcePSN,@SourceUrl,@SourceRootReg,@HtmlPSN,@HtmlUrl,@HtmlRootReg,@HtmlNameReg,@SEOTitle,@SEOKey,@SEODescription,@ReadLimit,@AddTime,@AddUserId,@UpdateUserId,@UpdateTime,@WaterPic,@IsWater,@Extcredits1,@Extcredits2,@Extcredits3,@Extcredits4,@Extcredits5,@ParentPath,@ArrChildId)
	SET @NodeId = @@IDENTITY
END
GO


/*   */
